#include <stdio.h>

int main(int argc, char const *argv[])
{
    int list[10], max, result = 0;
    for (size_t i = 0; i < 10; i++)
    {
        scanf("%d", &list[i]);
    }
    scanf("%d", &max);
    for (size_t i = 0; i < 10; i++)
    {
        if (list[i] <= max + 30)
        {
            result++;
        }
    }
    printf("%d", result);
    return 0;
}
